/*
socket options
*/

#ifndef _SERIAL_OPS_H
#define _SERIAL_OPS_H
#include "Common.h"
#include "communication/CommunicationDef.h"
namespace SerialOps
{
	HANDLE_FD OpenDevice(const char* pszDevice);
	bool SetSpeed(HANDLE_FD fd, int speed );

	bool SetParity(HANDLE_FD fd,int databits, int stopbits, int parity);

	// Disable blocking send/recv calls.
	bool Nonblocking(HANDLE_FD fd);

	// Enable blocking send/recv calls.
	bool Blocking(HANDLE_FD fd);

	// Closes socket completely.
	void CloseFD(HANDLE_FD fd);

	int32 Read(HANDLE_FD fd, char* pBuff,uint32 nBufferLen);

	int32 Write(HANDLE_FD fd, char* pBuff,uint32 nBufferLen);

};

#endif

